package com.example.opendemo.config;

import org.opencv.core.*;
import org.opencv.highgui.HighGui;
import org.opencv.imgcodecs.Imgcodecs;
import org.opencv.imgproc.Imgproc;
import org.opencv.objdetect.CascadeClassifier;
import org.opencv.videoio.VideoCapture;
import org.springframework.context.annotation.Configuration;

import java.io.File;
@Configuration
public class OpenCVLoader {

   static   {
        // 加载动态库
        String dir = System.getProperty("user.dir").replace("/", "\\");
        String filePath = "\\dll\\" + "x64" + "\\opencv_java480.dll";
        String path = dir.concat(filePath);
        File file = new File(path);
        if (!file.exists()) {
            throw new RuntimeException("找不到动态库".concat(path));
        }
        System.load(path);
       // System.out.println(path.concat("  load success"));
    }


}
